import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);

import user from "./user";
import home from "./home"
import search from "./search";
import detail from "./detail"
import addcartsuccess from "./addcartsuccess"

//VUE中的四个核心概念
const state = {
    //存储数据
};
const mutations = {
    //直接修改数据
};
const actions = {
    //与组件当中的用户对接
    //一般是异步发送请求
    //提交mutations
};
const getters = {
    //后面用来简化数据的
}

export default new Vuex.Store({
    state,
    mutations,
    actions,
    getters,
    //modules代表模块化
    modules:{
        user,
        home,
        search,
        detail,
        addcartsuccess,
    }
});